# -*- coding: utf-8 -*-
"""
@project: bert-text-classification

@author: bruce zhang

@desc:
"""

class Config:
    def __init__(self):
        self.train_file = './data/train.txt'
        self.dev_file = './data/dev.txt'
        self.test_file = './data/test.txt'
        self.label_file = './data/class.txt'
        self.batch_size = 100
        self.max_length = 50
        self.bert_path = './data/bert-base-chinese'
        self.use_cuda = False
        self.gpu = 0
        self.vocab = './data/bert-base-chinese/vocab.txt'
        self.hidden_dim = 768
        self.load_model = False
        self.load_path = None
        self.optim = 'Adam'
        self.lr = 5e-5
        self.lr_decay = 0.00001
        self.weight_decay = 0.00005
        self.checkpoint = 'result/'
        self.num_epoch = 5
        self.require_improvement = 1000
        self.class_list = [line.strip() for line in open(self.label_file, 'r', encoding='utf-8').readlines()]

    def update(self, **kwargs):
        for k, v in kwargs.items():
            setattr(self, k, v)

    def __str__(self):

        return '\n'.join(['%s:%s' % item for item in self.__dict__.items()])


